<template>
  <div>
    <v-header></v-header>
    <div class="myTop">
      <div class="div1">
        <!-- 头像 -->
        <div>
          <img src="./1111.jpg" alt="" />
        </div>

        <!-- 手机号和资料 -->
        <div>
          <p>133****1111</p>
          <p>完善资料让小u更懂你</p>
        </div>
        <!-- 每日签到 -->
        <div>
          <img src="./red_envelopes.png" alt="" />
          <span>每日签到</span>
        </div>
      </div>

      <div class="div2">
        <div>
          <p>12</p>
          <p>我的收藏</p>
        </div>
        <div>
          <p>12</p>
          <p>浏览记录</p>
        </div>
        <div>
          <p>￥0</p>
          <p>我的红包</p>
        </div>
        <div>
          <p>12</p>
          <p>优惠券</p>
        </div>
      </div>
      <!-- 我的订单 -->
      <div class="div3">
        <div>
          <p>我的订单</p>
          <p @click="allPay" class="allPay">全部订单></p>
        </div>
        <div>
          <!-- vgrid5 -->
          <div></div>
          <van-grid :border="false" :column-num="grids.length">
            <van-grid-item v-for="item in grids" :key="item.id">
              <van-image :src="item.src" />
              <span>{{ item.title }}</span>
            </van-grid-item>
          </van-grid>
        </div>
      </div>
    </div>
    <!-- 地址管理 -->
    <div class="bottom">
      <div class="main">
        <div @click="addressAdmin">
          <span><img src="./address.png" alt="" /></span>
          <span>地址管理</span>
          <span>></span>
        </div>
        <div>
          <span><img src="./wallet.png" alt="" /></span>
          <span>我的钱包</span>
          <span>剩余200U币></span>
        </div>
        <div>
          <span><img src="./QR_code.png" alt="" /></span>
          <span>我的二维码</span>
          <span>></span>
        </div>
        <div>
          <span><img src="./partner.png" alt="" /></span>
          <span>我的小伙伴</span>
          <span>></span>
        </div>
        <div>
          <span><img src="./free.png" alt="" /></span>
          <span>0元试用</span>
          <span>></span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import my01 from "./my01.png";
import my02 from "./my02.png";
import my03 from "./my03.png";
import my04 from "./my04.png";
export default {
  data() {
    return {
      grids: [
        { id: "001", src: my01, title: "待付款" },
        { id: "002", src: my02, title: "待发货" },
        { id: "003", src: my03, title: "待确认" },
        { id: "004", src: my04, title: "售后/退款" },
      ],
    };
  },
  methods: {
    // 地址管理
    addressAdmin() {
      this.$router.push("/address");
    },
    // 全部订单
    allPay() {
      this.$router.push('/allPay')
    },
  },
};
</script>

<style lang="less" scoped>
.allPay{
  z-index: 10;
}
.myTop {
  width: 100vw;
  height: 2rem;
  background-image: url("./my.jpg");
  background-repeat: repeat-x;
  padding: 0.1rem;
  box-sizing: border-box;
  position: relative;
  .div1 {
    // overflow: hidden;
    div {
      float: left;
      &:nth-child(1),
      img {
        width: 0.6rem;
        height: 0.6rem;
        border-radius: 50%;
      }
      &:nth-child(2) {
        margin-left: 0.1rem;
        margin-top: 0.05rem;
        color: white;
        font-weight: 600;
        p {
          &:nth-child(2) {
            font-size: 0.12rem;
            width: 1.2rem;
            height: 0.4rem;
            text-align: center;
            border: 1px solid;
          }
        }
      }
      &:nth-child(3) {
        float: right;
        margin-right: -0.15rem;
        width: 1rem;
        height: 0.3rem;
        border: 1px solid red;
        background-color: #ffd5ca;
        border-radius: 0.1rem 0 0 0.1rem;
        padding-left: 0.1rem;
        box-sizing: border-box;
        transform: scale(0.9);
        img {
          width: 0.2rem;
          height: 0.2rem;
          vertical-align: middle;
          // margin-top: ;
        }
        span {
          height: 0.3rem;
          font-size: 0.12rem;
          color: #eb471c;
          line-height: 0.3rem;
        }
      }
    }
  }
  .div2 {
    margin-top: 0.2rem;
    width: 100vw;
    float: left;
    display: flex;
    justify-content: space-evenly;
    margin-left: -0.1rem;
    div {
      float: left;
      font-size: 0.14rem;
      color: white;
      text-align: center;
      p {
        &:nth-child(1) {
          font-size: 0.17rem;
        }
      }
    }
  }
  .div3 {
    width: 90vw;
    height: 1rem;
    background-color: #fff;
    position: absolute;
    top: 75%;
    left: 5%;
    padding: 0.1rem;
    box-sizing: border-box;
    div {
      &:nth-child(1) {
        p {
          float: left;
          &:nth-child(1) {
            font-weight: 600;
          }
          &:nth-child(2) {
            float: right;
            font-size: 0.14rem;
            color: #ff7967;
          }
        }
      }
      &:nth-child(2) {
        width: 91.2vw;
        margin-left: -0.05rem;
        .van-grid span {
          font-size: 0.14rem;
        }
      }
    }
  }
}
.bottom {
  margin-top: -0.2rem;
  width: 100vw;
  height: 4.1rem;
  background-color: #ccc;
  overflow: hidden;
  .main {
    margin-top: 1.2rem;
    padding: 0.1rem;
    box-sizing: border-box;
    background-color: #fff;
    div {
      height: 0.4rem;

      span {
        &:nth-child(2) {
          margin-left: 0.1rem;
          font-weight: 600;
          font-size: 0.13rem;
        }
        &:nth-child(3) {
          float: right;
          color: #666;
          font-size: 0.12rem;
        }
      }
    }
  }
}
</style>